<template>
  <div>
    <test-login :ruleForm='testForm' :rules='testRules' @submit='submit' @errhandle='errhandle'>

    </test-login>
  </div>
</template>

<script>
export default {
  name:'test',
  data(){
    return{
      testForm:{
        username:'',
        password:''
      },
      testRules:{
        username:[{
          min:2,
          max:6,
          trigger:'blur',
          message:'用户名必须在2~6字符间'

        },
        {
          required:true,
          message:'用户名不能为空',
          trigger:'blur'
        }
      ],
      password:[{
          min:6,
          max:15,
          trigger:'blur',
          message:'密码必须在6~15字符间'
      },
      {
          required:true,
          message:'密码不能为空',
          trigger:'blur'
        }
      ]
      }
    }
  },
  methods:{
   submit(){
     this.$message.success('成功')
   },
   errhandle(){
this.$message.error('失败')
   }
  }
}
</script>

<style>

</style>